package day03;

//条件运算符的演示
public class OperDemo06 {
    public static void main(String[] args) {
        //6)条件运算符：boolean?数1：数2
        int a = 5, b = 10;
        int sum = a > b ? a : b;
        System.out.println("最大值是：" + sum);

        int num = 5;
        int flag = num > 0 ? 1 : -1;
        System.out.println(flag); //1
    }
}
